home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
051-075
/
scopedisk70
/
pcalc
/
pcalc.doc
< prev
next >
Wrap
Text File
|
1995-03-19
|
10KB
|
273 lines
Programmer's Calculator (PCalc)
A programmer's utility from Eggers ShareWare
------------------------------------------------------------------------------
Purchase price: $5
------------------------------------------------------------------------------
Copyright (C) 1987 Joseph A. Eggers
All rights reserved
If you decide to keep this product, send the purchase price to
Eggers Shareware
404 Emmet Avenue
Ferguson, MO 63135
If you decide not to keep this product, delete or give away all copies of it.
------------------------------------------------------------------------------
Special Deal
If you own (and have purchased) any other calculator from Eggers ShareWare, you
may keep the Programmer's Calculator without further remittance. Consider it
part of a package. Please register your ownership of the new calculator
though, so you will receive new product and update information.
If you do own others and you have not purchased them, why not do it now?
-------------------------------------------------------------------------------
Registration
If you would like to be registered as a user of this product, please include
the following information with your payment:
Name
Address
Product and version number
Where you got the product (optional)
Comments/suggestions (optional)
Registered users will receive notification of updates and new products.
===============================================================================
Programmer's Calculator
Features
* base conversion: binary, octal, decimal, hexadecimal
* bit level logic functions: AND, NOT, OR, NOR, NAND, XOR
* left-shift and right-shift functions (shift one bit)
* choice of working with signed or unsigned numbers
* math functions, including MOD (remainder after integer division)
* memory store, recall, add and subtract
* keyboard or mouse operation
* online help screen
Starting the calculator
To use the calculator from the Workbench, simply click twice on the PCalc
icon.
To use the calculator from a CLI, type PCALC or RUN PCALC if the calculator
is in the directory that is the current directory.
If the calculator is in a directory that is not the current directory, you
will have to type the directory name in front of PCALC, as in RUN DF1:PCALC
Ending the calculator
To quit using the calculator, you may do one of three things:
1) click in the close window gadget at the upper left of the calculator
2) press the ESC key when the calculator is the current window
3) hold down the CTRL key, then press the C key when the calculator is
the current window
If the help screen is displayed when you close the calculator window,
the help screen will go away also.
Using calculator functions
Entering numbers
Numbers can be entered by clicking on the key representing the number you
want to enter. Depending on what numeric base the calculator is in at
the time, some keys may not enter anything. If you are using octal numbers
for instance, pressing the 8, 9, A, B, C, D, E, and F keys will have no
effect.
Note that there is NO indication of overflow when it occurs. This is
because the calculator is intended to show you precisely what actually
happens to a numeric value when operations are done to it. If you are
interested in the fact that an overflow has occurred, you can just watch
it happen in the display.
Math functions
The mathematical functions provided are addition (+), subtraction (-),
multiplication (*), integer division (/), and remainder after integer
division (MOD). These all operate like you would expect. Enter the
first operand, then the math key, then the second operand, then the
equals key. The result of the operation is displayed in the window in
whatever base you are working in.
Bit-level logic functions
These functions are of two kinds: ones that operate on two numbers, the
way math functions work, and ones that operate on just one number. The two
number variety are called BINARY operations (no relation to being in BIN
display mode) and the one number variety are called UNARY operations.
Binary operations
The bit level binary operations are AND, OR, XOR, NOR, and NAND. You
use these the same way as you use any of the math functions.
Unary Operations
The bit level unary operations are NOT, left shift ( << ), and right
shift ( >> ). These operate on whatever value is in the display at
the time you do the operation. The NOT operation reverses the value of
every bit in the number, which is real obvious if you are in BIN display
mode, but not so obvious if you aren't. The shift operations shift
all the bits in the number one to the left or to the right. Bits shifted
"off the end" are lost forever. When using signed numbers, the sign bit
(high order bit) will be propagated when you shift right.
Signed and Unsigned Numbers
Using the S and U keys you can select whether you want to use signed or
unsigned numbers.
When using signed numbers, the high order bit of the number is interpreted
as a sign bit, rather than as part of the number. A one means the number is
negative, a zero means the number is positive. This obviously limits the size
of the number to whatever can be stored in 31 bits. When using signed
numbers, the sign bit will be propagated when you shift right.
When using unsigned numbers, all 32 bits are used to store the number, which
then must always be positive. Using that high order bit in the number allows
a value to be stored that is twice as large as the largest number that can
be stored as a signed number.
One of the S or the U keys will be highlighted to show you whether you
are using signed or unsigned numbers. The highlighted key will have its
text in a different color than the numeric keys on the calculator.
Numeric base conversions
The calculator can work in any of four numeric bases: base 2 (binary),
base 8 (octal), base 10 (decimal), and base 16 (hexadecimal). Converting
between the bases is accomplished by clicking on the key representing the
base you want to work in. The base you are in determines which of the
numeric keys are usable. If you are in base 2 for instance, none of the
numeric keys higher than 1 are usable, because only the digits 0 and 1 are
meaningful in base 2.
The key for the numeric base you are working in is displayed in a different
color than the others.
The calculator's memory
The calculator has a single memory where you can store a value for later
recall or for calculations while it is still in memory.
A number is stored in memory by pressing the M key. Whatever value is
displayed currently will be copied into the memory. Whenever the memory has
something in it, the M key will be highlighted to tell you it's there.
A number is recalled from memory by pressing the MR key. Whatever value
was in memory is copied to the display, and the value in the display is
lost. The value that was in memory stays in memory.
To add or subtract the value in the display with the value in the memory,
press the M+ or M- key. The result of the operation will be stored the
memory, and the display value will not change.
To clear the memory, press M when there is a zero in the display.
The Clear keys
To clear the last value entered, press the CE key. To clear everything in
the calculator except the memory, press the CA key.
Changing the sign of the display
To change the sign of the value in the display, press the +- key. If you
are using unsigned numbers, this key has no effect. Note that when you
in decimal mode, the change of sign is indicated by the presence or absence
of the negative sign to the left of the number, but when you are using a
different numeric base the change in sign is indicated by flipping the
high order sign bit and then propagating it.
Getting Help
Pressing the HELP key will display a window showing the keys on the keyboard
that you can use as alternatives to the calculator keys. You can leave this
window displayed while you continue to use the calculator. To close the help
window, use its close window gadget. This will not end the calculator. If
the help window is still displayed when you quit using the calculator, it
will be closed automatically.
Using the keyboard with the calculator
All of the keys on the calculator can be pressed by using the mouse or by
pressing an alternative key on the keyboard. The following table shows which
keyboard keys relate to which calculator keys. You can view this information
while using the calculator by viewing the help screen. In general though, most
keys with a single character on them can be pressed by pressing that character
key on the keyboard.
CALCULATOR KEYBOARD
------------------------
0 - F 0 - F
= =, RETURN, or ENTER
+, -, /, * +, -, /, *
S S
U U
MOD %
<< <
>> >
BIN CTRL-B the up and down arrow keys can also
OCT CTRL-O be used to go from one numeric base
DEC CTRL-D to another.
HEX CTRL-H
AND &
OR |
NOT !
XOR X
NAND #
NOR $
About ?
M M
MR R
M+ [
M- ]
+- P
CA K (think of "K"ill)
C DEL
quit PCALC ESC or CTRL-C
HELP HELP
-------------------------------------------------------------------------------
Eggers Shareware
404 Emmet Avenue
Ferguson, MO 63135
-------------------------------------------------------------------------------